<template>

    <div class="container" >
      <div class="left-box" >
<!--        <el-card class="box-card" shadow="hover" style="width: 100%" >-->

          <el-form ref="form" :model="form"  label-width="100px" >
            <el-tabs v-model="activeName" @tab-click="handleClick"  >
<!--              <el-tab-pane label="交班" name="first">-->
<!--              </el-tab-pane>-->
              <el-row>

                <el-form-item label="交班时间"  prop="handoverTime">
                  <el-date-picker clearable
                                  style="width: 100%"
                                  v-model="form.handoverTime"
                                  type="date"
                                  value-format="yyyy-MM-dd "
                                  readonly="true">
                  </el-date-picker>
                </el-form-item>
             </el-row>
            <el-row >
              <el-form-item label="班次" prop="sailings">
                 <el-input v-model="form.sailings" placeholder="请输入班次"  clearable      />
                </el-form-item>
              </el-row>
            </el-tabs>

          </el-form>

<!--        </el-card>-->
        <br>
        <div class="right" style="float: right;">
          <el-button type="primary" @click="qpqpq" >确 定</el-button>
          <el-button @click="cancel" >返 回</el-button>
        </div>
      </div>

<!--      <div class="right-box">-->
<!--        <el-card class="box-card" shadow="hover" style="width: 90%">-->

<!--        <el-table :data="barnumber" border  style="width: 100%">-->
<!--           <el-table-column type="selection"  align="center" />-->
<!--           <el-table-column prop="name" label="吧台号" ></el-table-column>-->
<!--&lt;!&ndash;                             <el-table-column prop="address" label="操作"></el-table-column>&ndash;&gt;-->

<!--         </el-table>-->
<!--        <br>-->
<!--          <br>-->
<!--       </el-card>-->
<!--        <br>-->
<!--       <div class="parent">-->
<!--        <div class="right" style="float: right;">-->
<!--            <el-button type="primary" @click="qpqpq" >确 定</el-button>-->
<!--           <el-button @click="cancel" >取 消</el-button>-->
<!--         </div>-->
<!--       </div>-->
<!--      </div>-->
    </div>





  <!-- 内容 -->
  <!--    <el-button type="primary" @click="submitForm">确 定</el-button>-->
  <!--    <el-button @click="cancel">取 消</el-button>-->


</template>

<script>
  import { listBills, getBills, delBills, addBills, updateBills,ppp } from "@/api/module/lys/bills";

  export default {
    name: "jiaoban",

    data() {
      return {

        title: "交班",
        open: false,
        barnumber: [{
          // date: '500',
          value:'101',
          name: '吧台1',
          // address: '110'
        }, {
          // date: '500',
          value:'102',
          name: '吧台2',
          // address: '110'
        },{
          // date: '500',
          value:'103',
          name: '吧台3',
          // address: '110'
        },{
          // date: '500',
          value:'104',
          name: '吧台4',
          // address: '110'
        },{
          // date: '500',
          value:'105',
          name: '吧台5',
          // address: '110'
        },{
          // date: '500',
          value:'106',
          name: '吧台6',
          // address: '110'
        },{
          // date: '500',
          value:'107',
          name: '吧台7',
          // address: '110'
        },],
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          userId: null,
          deptId: null,
          nickName: null,
          department: null,
          userName: null,
          post: null,
          handBrand: null,
          originalHand: null,
          handCategory: null,
          retentionStatus: null,
          mergeStatus: null,
          handState: null,
          numberOfPeople: null,
          allCost: null,
          openingTime: null,
          groupId: null,
          oddNumbers: null,
          children: null,
          mastercard: null,
          handoverTime: null,
          handoverStatus: null,
          barNumber: null,
          sailings: null,
          together: null,
          note: null,
          groupNotes: null,
          discountAmount: null,
          checkoutTime: null,
          supplementaryConsumption: null,
          paidInAmount: null,
          paidInCash: null,
          changeAmount: null,
          paymentMethod: null,
          totalConsumptionAmount: null,
          cardiner: null,
          checkout: null,
          frontSign: null,
          frontPrintTime: null,
          operator: null,
          checkoutLocation: null,
          note1: null,
          note2: null,
          note3: null,
          note4: null,
          note5: null,
          note6: null,
          note7: null,
          note8: null,
          note9: null,
          note10: null
        },
       form:{
         handoverTime:this.getNowTime()
          },

      }

    },
    created() {
      this.getList();
      this.getTreeselect();
      this.getNowTime();
    },
    methods:{




      qpqpq(){



        this.$modal.confirm('是否确认交班？').then(function() {
        }).then(() => {
          ppp(this.form).then(response => {
            this.$modal.msgSuccess("交班成功");
            // this.open = false;
            this.getList();
        }).catch(() => {});










        });

      },

      cancel() {
        this.$emit("closeDialog"); // 触发 closeDialog 事件
        this.reset();
      },
      getNowTime() {
        var now = new Date();
        var year = now.getFullYear(); //得到年份
        var month = now.getMonth(); //得到月份
        var date = now.getDate(); //得到日期
        month = month + 1;
        month = month.toString().padStart(2, "0");
        date = date.toString().padStart(2, "0");
        var defaultDate = `${year}-${month}-${date}`;
        return defaultDate;
      },

    }
  }
</script>

<style scoped>
  .container {
    display: flex;
    flex-wrap: wrap;
  }
  .left-box {
    flex: 1;
  }
  .right-box {
    flex: 1;
  }
</style>
